List manipulation in Turbo Prolog
نویسنده
چکیده
The present paper is concerned with list processing in Turbo Prolog language. It doesn't claim to be an exhaustive description of operations which can be performed upon lists. Nevertheless adduced programs are most representative, more or less known to specialists in logic programming domain. By means of examples are explained the list manipulation techniques, use of recursion, declarative comparison of predicates, analysis and fix-ation of acceptable prototypes and some problems of predicates' inconsistency. Lists are the basic data structure in Turbo Prolog programs and the most valuable programming technique is recursion. A list is an ordered sequence of arbitrary length of elements. The order of elements in the sequence is essential. In case the order is changed we are having a new list. At the same time the list may be conceived (if desired) at a logical level as a set, going aside the order of elements. The list in Turbo Prolog is a binary structure,i.e. the first argument is the first element, the second is the recursive defined rest of list. Thus the list is represented as [X|Xs], where arguments X and Xs describe the head and the tail correspondingly. Here and than, when it is possible, if X is the list head, then Xs represents the list tail. Recursion allows us to process the elements of list. To avoid an infinite recursion there is a necessity of presence of a constant symbol. This is the empty list, which is presented by [ ]. As the list elements can be anything: constants, variables, and surely structures that contain other lists. The only prerequisite is that all elements in a list must belong to the same type.
منابع مشابه
Clause and effect - Prolog programming for the working programmer
clause and effect prolog programming for the working clause and effect link.springer clause and effect prolog programming for the working william f. clocksin clause and effect clause and effect prolog programming for the working [pdf] mass effect: retribution pdf-ebook-reader-9b9b2 the advertising effect pdf book library prolog wizard: a wiley programmer's reference pdf turbo prolog programmer'...
متن کاملModular CompilerArchitecture for aData Manipulation
We describe a modular compiler architecture that has been developed over the years for a functional data model DBMS. This has proved itself in practice, when major extensions have been developed quickly by reuse of modules (possibly reordered) saving much development time. We analyse the reasons for success and discuss the intermediate code (ICode) format used to communicate between modules. Th...
متن کاملInterim report on the Visualisation of Prolog execution in three dimensions
ABSTRACT A simple, expressively complete, prototype system is presented for visual programming in Prolog, and for the complete visualisation of the execution of Prolog programs in three spatial dimensions. The first part of this system, known as VPP (short for Visual Programming in Prolog) enables users to edit and create Prolog programs graphically by manipulating and connecting graphical symb...
متن کاملRinel Bhownath 204505465
.................................................................................................................................... iv List of Figures ........................................................................................................................ viii List of Symbols ..........................................................................................................
متن کاملProlog(elex): a New Tool to Generate Prolog Tokenizers
This paper presents a tool called Elex(Prolog) to construct tokenizers (lexical analysers, scanners , lexers) in Prolog. It is based on Elex, a multilingual scanner generator by Matthew Phillips. The paper motivates the tool, and presents its functionality and implementation. It also compares Elex(Prolog) to the only alternative Prolog scanner generator that we are aware of: plex. 1 Motivation ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- The Computer Science Journal of Moldova
دوره 3 شماره
صفحات -
تاریخ انتشار 1995